home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / ALEXLEVI / DEMO / DEMOUSE.PAS < prev    next >
Pascal/Delphi Source File  |  1994-04-12  |  2KB  |  101 lines

  1.  
  2. (*
  3.  
  4. ****************************************************************************
  5. *                                                                          *
  6. *     This procedure was made by Alex Levitas' "Mouse Cursor Editor".      *
  7. *                                                                          *
  8. ****************************************************************************
  9.  
  10.  This procedure changes mouse cursor icon in graphic mode.
  11.  
  12.                             W A R N I N G ! ! !
  13.  This procedure DOES NOT check mouse existence, DOES NOT initialize mouse,
  14.  but  ONLY  change icon  of active  initialized  mouse in graphic mode ! !
  15.  
  16.  PROCEDURE WILL WORK ONLY WITH PASCAL 6.0 OR HIGHER !
  17.  
  18.  To use this procedure in your program, insert the directive
  19.  
  20.     {$I DEMOUSE.PAS}
  21.  
  22.  If you want to use more than one changed icon in your program, you
  23.  must change procedure name in each source file.
  24.  
  25. *)
  26.  
  27. procedure ChangeMouseCursor;
  28.  
  29. type
  30.  
  31.    Mask = array [0..15] of word;
  32.  
  33.    Graph_Mouse = record
  34.      ScreenMask,
  35.      CursorMask  : Mask;
  36.      HotX,
  37.      HotY        : word;
  38.    end;
  39.  
  40. const
  41.  
  42. MouseCursor : Graph_Mouse  = (
  43.      ScreenMask:(
  44.                  57375,
  45.                  57375,
  46.                  57375,
  47.                  49167,
  48.                  32775,
  49.                      3,
  50.                      3,
  51.                      1,
  52.                      3,
  53.                      3,
  54.                  32775,
  55.                  49167,
  56.                  57375,
  57.                  57375,
  58.                  57375,
  59.                  65535
  60.                 );
  61.      CursorMask:(
  62.                      0,
  63.                   4032,
  64.                   4032,
  65.                   4128,
  66.                   8464,
  67.                  16648,
  68.                  16648,
  69.                  16652,
  70.                  16904,
  71.                  17416,
  72.                   8208,
  73.                   4128,
  74.                   4032,
  75.                   4032,
  76.                      0,
  77.                      0
  78.                 );
  79.      HotX:(7); HotY:(7));
  80.  
  81. var
  82.  
  83.    Segm,Offs : word;
  84.  
  85. begin
  86.    Segm:=seg(MouseCursor.ScreenMask);
  87.    Offs:=ofs(MouseCursor.ScreenMask);
  88.    asm
  89.       PUSH  ES
  90.       MOV   AX, Segm
  91.       MOV   ES, AX
  92.       MOV   DX, Offs
  93.       MOV   BX, MouseCursor.HotX
  94.       MOV   CX, MouseCursor.HotY
  95.       MOV   AX, 9
  96.       INT   33h
  97.       POP   ES
  98.    end;
  99. end;
  100.  
  101.